<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>

</head>
<style>
    .grid-container {
        display: grid;
        grid-template-columns: auto auto;
        grid-gap: 10px;
        margin: 20px;
    }

    .grid-item {
        /* background-color: #{{ random_color }}; */
        border-radius: 10px;
        padding: 10px;
        text-align: center;
        color: white;
        height: 80px; /* Increase item height */
        display: flex;
        justify-content: center;
        align-items: center;
    }
</style>
<body>
    <div class="grid-container">
        <div class="grid-item">文本1</div>
        <div class="grid-item">文本2</div>
        <div class="grid-item">文本3</div>
        <div class="grid-item">文本4</div>
        <div class="grid-item">文本5</div>
    </div>
</body>
<script>
    function getRandomDarkColor() {
        var letters = '012345';
        var color = '#';
        for (var i = 0; i < 3; i++) {
            color += letters[Math.floor(Math.random() * 6)];
        }
        return color;
    }

    document.addEventListener('DOMContentLoaded', function() {
        var items = document.querySelectorAll('.grid-item');
        items.forEach(function(item) {
            item.style.backgroundColor = getRandomDarkColor();
        });
    });
</script>
</html>